From: Mihai Donțu Date: Tue, 6 Jan 2015 12:49:52 +0000 (+0000) Subject: x86/HVM: prevent use-after-free when destroying a domain X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3995 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=d3c151fd3a4365fc6107198bfc975807d40d157d;p=xen.git x86/HVM: prevent use-after-free when destroying a domain hvm_domain_relinquish_resources() can free certain domain resources which can still be accessed, e.g. by HVMOP_set_param, while the domain is being cleaned up. This is CVE-2015-0361 / XSA-116. Signed-off-by: Mihai Donțu Tested-by: Răzvan Cojocaru Reviewed-by: Andrew Cooper Reviewed-by: Jan Beulich --- diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index bc414ff228..72be5b9f68 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -1487,9 +1487,6 @@ int hvm_domain_initialise(struct domain *d) void hvm_domain_relinquish_resources(struct domain *d) { - xfree(d->arch.hvm_domain.io_handler); - xfree(d->arch.hvm_domain.params); - if ( is_pvh_domain(d) ) return; @@ -1511,6 +1508,9 @@ void hvm_domain_relinquish_resources(struct domain *d) void hvm_domain_destroy(struct domain *d) { + xfree(d->arch.hvm_domain.io_handler); + xfree(d->arch.hvm_domain.params); + hvm_destroy_cacheattr_region_list(d); if ( is_pvh_domain(d) )